package org.wj.arithmetic

import org.apache.spark.rdd.RDD
import org.wj.config.LocalSparkContext

object GroupByKey extends App with LocalSparkContext{

  private val rdd: RDD[(Int, Int)] = sc.parallelize(Array((1, 2), (1, 3), (1, 4), (2, 1), (2, 3), (2, 4)))

  rdd.groupByKey().foreach(print(_))

}
